<template>
  <div>
    <ul v-for="i in data" :key="i.id">
      <li>
        <van-button @click="shenhe(i.id)">审核</van-button>
      </li>
    </ul>

    <van-dialog v-model:show="show" title="标题" show-cancel-button>

      <van-field :label='描述信息' v-model='descipt'/>
      <van-radio-group v-model="is_agree">
        <van-radio name="2">通过</van-radio>
        <van-radio name="3">未通过</van-radio>
      </van-radio-group>
      <van-button @click='submit'>提交</van-button>
    </van-dialog>

  </div>
</template>

<script>
import axios from 'axios'

export default {
  name: "shenhe",
  data() {
    return {
      data: [],
      id: 0,
      show: false,
      descipt: '',
      is_agree: 2,
    }
  },
  methods: {
    shenhe(id) {
      this.id = id
      this.show = true
    },
    getlist() {
      axios.get('', 'get')
          .then(res => {
            this.data = res.data.list
          })
    },
    submit() {
      axios.post('/audit', {
        'id': this.id, 'descipt': this.descipt,
        'is_agree': this.is_agree
      })
          .then(res => {
            console.log(res)
          })
    }
  },
  mounted() {
    this.getlist()
  }
}
</script>

<style scoped>

</style>
